package com.litchi.bean;

import java.io.Serializable;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;

@Table(name = "in_cart")
public class InCart extends Model implements Serializable, Cloneable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3584698829991048916L;
	@Column
	String goodsId; // id
	@Column
	String goodsName; // 名称
	@Column
	String goodsIcon; // 图片
	@Column
	double goodsPrice; // 价格
	@Column
	int isFavor; // 是否已关注
	@Column
	int num; // 购物车中数量

	public InCart() {
	}

	public InCart(String goodsId, String goodsName, String goodsIcon,
			 double goodsPrice,  
			  int isFavor, int num) {
		super();
		this.goodsId = goodsId;
		this.goodsName = goodsName;
		this.goodsIcon = goodsIcon;
		this.goodsPrice = goodsPrice;
		this.isFavor = isFavor;
		this.num = num;
	}

	 

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		InCart other = (InCart) obj;
		if (goodsIcon == null) {
			if (other.goodsIcon != null)
				return false;
		} else if (!goodsIcon.equals(other.goodsIcon))
			return false;
		if (goodsId == null) {
			if (other.goodsId != null)
				return false;
		} else if (!goodsId.equals(other.goodsId))
			return false;
		if (goodsName == null) {
			if (other.goodsName != null)
				return false;
		} else if (!goodsName.equals(other.goodsName))
			return false;
		if (Double.doubleToLongBits(goodsPrice) != Double
				.doubleToLongBits(other.goodsPrice))
			return false;
		if (isFavor != other.isFavor)
			return false;
		if (num != other.num)
			return false;
		return true;
	}

	public String getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}

	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	public String getGoodsIcon() {
		return goodsIcon;
	}

	public void setGoodsIcon(String goodsIcon) {
		this.goodsIcon = goodsIcon;
	}

	public double getGoodsPrice() {
		return goodsPrice;
	}

	public void setGoodsPrice(double goodsPrice) {
		this.goodsPrice = goodsPrice;
	}

	public int getIsFavor() {
		return isFavor;
	}

	public void setIsFavor(int isFavor) {
		this.isFavor = isFavor;
	}

	public int getNum() {
		return num;
	}

	public void setNum(int num) {
		this.num = num;
	}

	@Override
	public InCart clone() {
		return new InCart(goodsId, goodsName, goodsIcon , goodsPrice,
				  isFavor, num);
	}
}
